<?php

class SRateTbl_sb extends SRate_sb
{

    public $sLottoId = 0;
    public $diskIdxArr = array
        (
        "a"=>1,
        "b"=>2,
        "c"=>3,
        "d"=>4
    );
    public $show5N = false;
    public $tblW = "753";
    public $reloadUrl = "#";
    public $subURL = "#";
    public $tblNo = 0;
    public $subid = 0;
    public $diskName = "";
    public $bignumArr = array();

    public function show_srateTbl($playtype = "r1",$disk = "a",$subid = 0,$bid = 0)
    {
        global $g_colorname3;
        global $g_colorname;
        global $g_disk_name;
        global $g_betXYArr;
        $tempIdx = $this->diskIdxArr[$disk];
        $this->diskName = $g_disk_name[$tempIdx];
        $this->bignumArr = array(1=>"一",2=>"二",3=>"三");
        switch ( $playtype )
        {
            case "r1" :
                return $this->show_r1($disk,$subid);
			case "r2" :
                return $this->show_r2($disk,$subid);
			case "r3" :
                return $this->show_r3($disk,$subid);
			case "r4" :
                return $this->show_r4($disk,$subid);
			case "r5" :
                return $this->show_r5($disk,$subid);
            default :
                return "系统维护中 -1";
        }
    }
    public function crtDblSubmitBtn($url = "")
    {
        $str = "";
        $str .= "<input type=\"submit\" value=\"确定更改 :: " . $this->diskName . "赔率\" class=\"colorBtnGray\"  />";
        $str .= "&nbsp;<input type=\"button\" value=\"重读\" onclick=\"javascript:location.replace(" . "'" . $this->reloadUrl . "'" . ");\" class=\"colorBtnGray\"  />";
        return $str;
    }

    public function crtDblCopyRateBtn($url = "")
    {
        $msg = $this->sLottoId ? "本期" : "基本赔率";
        if ( $this->gametype == 24 )
        {
            $str = "";
            $str .= "<input type=\"button\" onclick=\"javascript:copyRateBtnSub('确定要把 " . $msg . " 平码一定位玩法(X,Y盘,a,b,c,d盘)的赔率复制到平码二~四及特码定位玩法吗？');\" value=\"复制赔率 :: 将「冠军」之赔率同步至「第二~第十位」\" class=\"colorBtnGray\"  />";
            $str .= "<ul>「复制赔率」使用说明:<li style=\"font-weight:bold;color:red\">使用前请先储存平码一定位玩法的赔率</li><li>按下复制赔率一钮後，系统将自动把平码一定位玩法(X,Y盘,a,b,c,d盘)的赔率复制到平码二~四及特码定位玩法，<br />原平码二~四定位玩法之赔率将被复盖\，不保留</li><li>使用复制赔率後，请切换至平码二~四及特码定位玩法页，检查赔率(X,Y盘,a,b,c,d盘)是否已和平码一同步</li></ul>";
        }
        else if ( $this->_5hFlag )
        {
            $str = "";
            $str .= "<input type=\"button\" onclick=\"javascript:copyRateBtnSub('确定要把 " . $msg . " 平码一定位玩法(X,Y盘,a,b,c,d盘)的赔率复制到平码二~四及特码定位玩法吗？');\" value=\"复制赔率 :: 将「平码一」定位玩法之赔率同步至「平码二~四及特码」定位玩法\" class=\"colorBtnGray\"  />";
            $str .= "<ul>「复制赔率」使用说明:<li style=\"font-weight:bold;color:red\">使用前请先储存平码一定位玩法的赔率</li><li>按下复制赔率一钮後，系统将自动把平码一定位玩法(X,Y盘,a,b,c,d盘)的赔率复制到平码二~四及特码定位玩法，<br />原平码二~四定位玩法之赔率将被复盖\，不保留</li><li>使用复制赔率後，请切换至平码二~四及特码定位玩法页，检查赔率(X,Y盘,a,b,c,d盘)是否已和平码一同步</li></ul>";
        }
        else
        {
            $str = "";
            $str .= "<input type=\"button\" onclick=\"javascript:copyRateBtnSub('确定要把 " . $msg . " 第一球玩法(a,b,c,d盘)的赔率复制到第二~八球定位玩法吗？');\" value=\"复制赔率 :: 将「第一球」定位玩法之赔率同步至「第二~八球」定位玩法\" class=\"colorBtnGray\"  />";
            $str .= "<ul>「复制赔率」使用说明:<li style=\"font-weight:bold;color:red\">使用前请先储存第一球定位玩法的赔率</li><li>按下复制赔率一钮後，系统将自动把第一球定位玩法(a,b,c,d盘)的赔率复制到第二~八球定位玩法，<br />原第二~八球定位玩法之赔率将被复盖\，不保留</li><li>使用复制赔率後，请切换至第二~八球定位玩法页，检查赔率(a,b,c,d盘)是否已和第一球同步</li></ul>";
        }
        return $str;
    }
	
    public function crt_2face_td_xy($rdata,$bettype,$subid,$betNamArr,$disk,$classN = "",$tdIdStr = "")
    {
        $str = "";
        $setBtnId = "";
        $setBtnNamePre = "n_" . $bettype . "_" . $subid . "_" . $disk . "_";
        $idx = 0;
        $colNum = 1;
        $i = 0;
		$l = count($betNamArr);
		while ( $i < $l )
		{
			if ( $betNamArr[$i] == "" )
			{
				$str .= ( "<td colspan=\"" . ( $colNum + 1 ) ) . "\">&nbsp;</td>";
			}
			else
			{
				$num = str_pad($i + 1,2,"0",STR_PAD_LEFT);
				$setBtnName = $setBtnNamePre . $num;
				$ridx = "r" . $num;
				$rate_0 = floatval($rdata[0][$ridx]);
				$classShow = $classN ? $classN . $num : "";
				$str .= "<th class=\"td6 " . $classShow . " \">" . $betNamArr[$i] . "</th>";
				$str .= "<td colspan=\"" . $colNum . "\" align=\"left\" style=\"padding-left:10px;\"><input type=\"text\" class=\"iptRate " . $tdIdStr . "\" size=\"6\" name=\"" . $setBtnName . "_0\" value=\"" . $rate_0 . "\"  />";
				$str .= "<input onclick=\"btnAdd1([" . $setBtnName . "_0],-0.01)\" type=\"button\" class=\"colorBtnGray\" value=\" -  \" TabIndex=\"9999\" /><input onclick=\"btnAdd1([" . $setBtnName . "_0],0.01)\" type=\"button\" class=\"colorBtnGray\" value=\" + \" TabIndex=\"9999\" />";
				$str .= "</td>";
			}
			if($i%4==3) $str.="</tr><tr  class=\"td2\">";
			++ $i;
		}
        return $str;
    }

    public function show_r1($disk = "a")
    {
        $strDisk = "";
        $idx = $this->diskIdxArr[$disk];
        $class = "gray" . $idx;
        $strTbl_header = "<thead class=\"bgClc_" . $this->gametype . "\"><tr><th>类别</th>";
        $strTbl_header .= "<th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th>";
        $strTbl_header .= "</tr></thead>";
        $strTbl00 = "";
        $subid = 0;
        $bettype = 0;
        $strTbl00 .= "<tr class=\"td2\"><th rowspan=2 class=\"" . $class . "\">三军</th>";
        $strTbl00 .= $this->crt_2face_td_xy($this->getRateArrXY(0,$idx,$subid),0,0,array("<img src='skin/1/img/ball/1.png' width='20px'>","<img src='skin/1/img/ball/2.png' width='20px'>","<img src='skin/1/img/ball/3.png' width='20px'>","<img src='skin/1/img/ball/4.png' width='20px'>","<img src='skin/1/img/ball/5.png' width='20px'>","<img src='skin/1/img/ball/6.png' width='20px'>","",""),$idx,"intSJ");
		$strTbl00 .= "</tr>";
        $strTbl00 .= "<tr class=\"td2\"><th rowspan=2 class=\"" . $class . "\">双面</th>";
        $strTbl00 .= $this->crt_2face_td_xy($this->getRateArrXY(1,$idx,$subid),1,0,array("<img src='skin/1/img/ball/7.jpg' width='20px'>","<img src='skin/1/img/ball/8.jpg' width='20px'>","",""),$idx,"intDX");
		$strTbl00 .= "</tr>";
        $strTbl = "<style>.tbdRate tbody{ border-top:2px dashed #A9A9A9; }</style><table class=\"tblMy3D\" width=\"" . $this->tblW . "\"  style=\"text-align:center\">";
        $strTbl .= $strTbl_header;
        $strTbl .= "<tbody class=\"tbdRate\">" . $strTbl00 . "</tbody>";
		$strTbl .= "<tr><td colspan=\"13\" class=\"td2\" align=\"right\">" . $this->crtDblSubmitBtn() . "</td></tr>";
        $strTbl .= "</table>";
        return $strTbl;
    }
	
	public function show_r2($disk = "a")
    {
        $strDisk = "";
        $idx = $this->diskIdxArr[$disk];
        $class = "gray" . $idx;
        $strTbl_header = "<thead class=\"bgClc_" . $this->gametype . "\"><tr><th>类别</th>";
        $strTbl_header .= "<th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th>";
        $strTbl_header .= "</tr></thead>";
        $strTbl00 = "";
        $subid = 0;
        $bettype = 0;
        $strTbl00 .= "<tr class=\"td2\"><th rowspan=2 class=\"" . $class . "\">短牌</th>";
        $strTbl00 .= $this->crt_2face_td_xy($this->getRateArrXY(3,$idx,$subid),3,0,array("<img src='skin/1/img/ball/1.png' width='20px'><img src='skin/1/img/ball/1.png' width='20px'>","<img src='skin/1/img/ball/2.png' width='20px'><img src='skin/1/img/ball/2.png' width='20px'>","<img src='skin/1/img/ball/3.png' width='20px'><img src='skin/1/img/ball/3.png' width='20px'>","<img src='skin/1/img/ball/4.png' width='20px'><img src='skin/1/img/ball/4.png' width='20px'>","<img src='skin/1/img/ball/5.png' width='20px'><img src='skin/1/img/ball/5.png' width='20px'>","<img src='skin/1/img/ball/6.png' width='20px'><img src='skin/1/img/ball/6.png' width='20px'>","",""),$idx,"intDP");
		$strTbl00 .= "</tr>";
        $strTbl00 .= "<tr class=\"td2\"><th rowspan=2 class=\"" . $class . "\">其它</th>";
        $strTbl00 .= $this->crt_2face_td_xy($this->getRateArrXY(8,$idx,$subid),8,0,array("<img src='skin/1/img/ball/9.jpg' width='40px'>","<img src='skin/1/img/ball/10.jpg' width='40px'>","",""),$idx,"intDZ");
		$strTbl00 .= "</tr>";
        $strTbl = "<style>.tbdRate tbody{ border-top:2px dashed #A9A9A9; }</style><table class=\"tblMy3D\" width=\"" . $this->tblW . "\"  style=\"text-align:center\">";
        $strTbl .= $strTbl_header;
        $strTbl .= "<tbody class=\"tbdRate\">" . $strTbl00 . "</tbody>";
		$strTbl .= "<tr><td colspan=\"13\" class=\"td2\" align=\"right\">" . $this->crtDblSubmitBtn() . "</td></tr>";
        $strTbl .= "</table>";
        return $strTbl;
    }
   	public function show_r3($disk = "a")
    {
        $strDisk = "";
        $idx = $this->diskIdxArr[$disk];
        $class = "gray" . $idx;
        $strTbl_header = "<thead class=\"bgClc_" . $this->gametype . "\"><tr><th>类别</th>";
        $strTbl_header .= "<th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th>";
        $strTbl_header .= "</tr></thead>";
        $strTbl00 = "";
        $subid = 0;
        $bettype = 0;
        $strTbl00 .= "<tr class=\"td2\"><th rowspan=2 class=\"" . $class . "\">豹子</th>";
        $strTbl00 .= $this->crt_2face_td_xy($this->getRateArrXY(4,$idx,$subid),4,0,
		array("<img src='skin/1/img/ball/1.png' width='20px'><img src='skin/1/img/ball/1.png' width='20px'><img src='skin/1/img/ball/1.png' width='20px'>",
		"<img src='skin/1/img/ball/2.png' width='20px'><img src='skin/1/img/ball/2.png' width='20px'><img src='skin/1/img/ball/2.png' width='20px'>",
		"<img src='skin/1/img/ball/3.png' width='20px'><img src='skin/1/img/ball/3.png' width='20px'><img src='skin/1/img/ball/3.png' width='20px'>",
		"<img src='skin/1/img/ball/4.png' width='20px'><img src='skin/1/img/ball/4.png' width='20px'><img src='skin/1/img/ball/4.png' width='20px'>",
		"<img src='skin/1/img/ball/5.png' width='20px'><img src='skin/1/img/ball/5.png' width='20px'><img src='skin/1/img/ball/5.png' width='20px'>",
		"<img src='skin/1/img/ball/6.png' width='20px'><img src='skin/1/img/ball/6.png' width='20px'><img src='skin/1/img/ball/6.png' width='20px'>","",""),$idx,"intDP");
		$strTbl00 .= "</tr>";
        $strTbl00 .= "<tr class=\"td2\"><th  class=\"" . $class . "\"></th>";
        $strTbl00 .= $this->crt_2face_td_xy($this->getRateArrXY(5,$idx,$subid),5,0,array("<img src='skin/1/img/ball/11.jpg' width='60px'>","","",""),$idx,"intDZ");
		$strTbl00 .= "</tr>";
        $strTbl = "<style>.tbdRate tbody{ border-top:2px dashed #A9A9A9; }</style><table class=\"tblMy3D\" width=\"" . $this->tblW . "\"  style=\"text-align:center\">";
        $strTbl .= $strTbl_header;
        $strTbl .= "<tbody class=\"tbdRate\">" . $strTbl00 . "</tbody>";
		$strTbl .= "<tr><td colspan=\"13\" class=\"td2\" align=\"right\">" . $this->crtDblSubmitBtn() . "</td></tr>";
        $strTbl .= "</table>";
        return $strTbl;
    }
	public function show_r4($disk = "a")
    {
        $strDisk = "";
        $idx = $this->diskIdxArr[$disk];
        $class = "gray" . $idx;
        $strTbl_header = "<thead class=\"bgClc_" . $this->gametype . "\"><tr>";
        $strTbl_header .= "<th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th>";
        $strTbl_header .= "</tr></thead>";
        $strTbl00 = "";
        $subid = 0;
        $bettype = 0;
        $strTbl00 .= "<tr class=\"td2\">";
        $strTbl00 .= $this->crt_2face_td_xy($this->getRateArrXY(6,$idx,$subid),6,0,
		array("<img src='skin/1/img/ball/1.png' width='20px'><img src='skin/1/img/ball/2.png' width='20px'>",
		"<img src='skin/1/img/ball/1.png' width='20px'><img src='skin/1/img/ball/3.png' width='20px'>",
		"<img src='skin/1/img/ball/1.png' width='20px'><img src='skin/1/img/ball/4.png' width='20px'>",
		"<img src='skin/1/img/ball/1.png' width='20px'><img src='skin/1/img/ball/5.png' width='20px'>",
		"<img src='skin/1/img/ball/1.png' width='20px'><img src='skin/1/img/ball/6.png' width='20px'>",
		"<img src='skin/1/img/ball/2.png' width='20px'><img src='skin/1/img/ball/3.png' width='20px'>",
		"<img src='skin/1/img/ball/2.png' width='20px'><img src='skin/1/img/ball/4.png' width='20px'>",
		"<img src='skin/1/img/ball/2.png' width='20px'><img src='skin/1/img/ball/5.png' width='20px'>",
		"<img src='skin/1/img/ball/2.png' width='20px'><img src='skin/1/img/ball/6.png' width='20px'>",
		"<img src='skin/1/img/ball/3.png' width='20px'><img src='skin/1/img/ball/4.png' width='20px'>",
		"<img src='skin/1/img/ball/3.png' width='20px'><img src='skin/1/img/ball/5.png' width='20px'>",
		"<img src='skin/1/img/ball/3.png' width='20px'><img src='skin/1/img/ball/6.png' width='20px'>",
		"<img src='skin/1/img/ball/4.png' width='20px'><img src='skin/1/img/ball/5.png' width='20px'>",
		"<img src='skin/1/img/ball/4.png' width='20px'><img src='skin/1/img/ball/6.png' width='20px'>",
		"<img src='skin/1/img/ball/5.png' width='20px'><img src='skin/1/img/ball/6.png' width='20px'>",""),$idx,"intDP");
		$strTbl00 .= "</tr>";
        $strTbl = "<style>.tbdRate tbody{ border-top:2px dashed #A9A9A9; }</style><table class=\"tblMy3D\" width=\"" . $this->tblW . "\"  style=\"text-align:center\">";
        $strTbl .= $strTbl_header;
        $strTbl .= "<tbody class=\"tbdRate\">" . $strTbl00 . "</tbody>";
		$strTbl .= "<tr><td colspan=\"13\" class=\"td2\" align=\"right\">" . $this->crtDblSubmitBtn() . "</td></tr>";
        $strTbl .= "</table>";
        return $strTbl;
    }
	public function show_r5($disk = "a")
    {
        $strDisk = "";
        $idx = $this->diskIdxArr[$disk];
        $class = "gray" . $idx;
        $strTbl_header = "<thead class=\"bgClc_" . $this->gametype . "\"><tr>";
        $strTbl_header .= "<th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th><th>项目</th><th>赔率</th>";
        $strTbl_header .= "</tr></thead>";
        $strTbl00 = "";
        $subid = 0;
        $bettype = 0;
        $strTbl00 .= "<tr class=\"td2\">";
        $strTbl00 .= $this->crt_2face_td_xy($this->getRateArrXY(7,$idx,$subid),7,0,array(
		"<img src='skin/1/img/ball/a4.png' width='40px'>",
		"<img src='skin/1/img/ball/a5.png' width='40px'>",
		"<img src='skin/1/img/ball/a6.png' width='40px'>",
		"<img src='skin/1/img/ball/a7.png' width='40px'>",
		"<img src='skin/1/img/ball/a8.png' width='40px'>",
		"<img src='skin/1/img/ball/a9.png' width='40px'>",
		"<img src='skin/1/img/ball/a10.png' width='40px'>",
		"<img src='skin/1/img/ball/a11.png' width='40px'>",
		"<img src='skin/1/img/ball/a12.png' width='40px'>",
		"<img src='skin/1/img/ball/a13.png' width='40px'>",
		"<img src='skin/1/img/ball/a14.png' width='40px'>",
		"<img src='skin/1/img/ball/a15.png' width='40px'>",
		"<img src='skin/1/img/ball/a16.png' width='40px'>",
		"<img src='skin/1/img/ball/a17.png' width='40px'>","",""),$idx,"intDP");
		$strTbl00 .= "</tr>";
        $strTbl = "<style>.tbdRate tbody{ border-top:2px dashed #A9A9A9; }</style><table class=\"tblMy3D\" width=\"" . $this->tblW . "\"  style=\"text-align:center\">";
        $strTbl .= $strTbl_header;
        $strTbl .= "<tbody class=\"tbdRate\">" . $strTbl00 . "</tbody>";
		$strTbl .= "<tr><td colspan=\"13\" class=\"td2\" align=\"right\">" . $this->crtDblSubmitBtn() . "</td></tr>";
        $strTbl .= "</table>";
        return $strTbl;
    }
    public function getRateArrXY($bettype,$diskIdx,$subid)
    {
        $rateArr = array();
		$rateArr[0] = $this->getRates($this->sLottoId,$diskIdx,$bettype,$subid);
        return $rateArr;
    }

}

?>